#!/bin/sh
WWORKPATH=`pwd`
WBASEPATH=`dirname $0`
echo "WBASEPATH=$WBASEPATH"
echo "WWORKPATH=$WWORKPATH"
cd "$WBASEPATH"

echo $?

NUMVER=`git rev-list --all --count`
GITVERSION=`git describe --tags --always --dirty=-m --abbrev=2`
  
cat "./version.h.template" | sed "s/\$FULL_VERSION/$GITVERSION/g" | sed "s/\$NUMVER/$NUMVER/g" > "./inc/version.h"
echo "Generated version.h"
echo "GITVERSION=$GITVERSION"
echo "NUMVER=$NUMVER"
cd "$WWORKPATH"

#bash .\\node_modules\\atb110x-sdk\\gitver.sh
